TOOL.Category		= "PDMG"
TOOL.Name			= "#Tool_pdmg_indest"

if CLIENT then
	language.Add( "Tool_pdmg_indest", "PDMG - Indestructible Tool" )
	language.Add( "Tool_pdmg_indest_name", "PDMG - Indestructible Tool" )
	language.Add( "Tool_pdmg_indest_desc", "Make's whatever you click on indestructible." )
	language.Add( "Tool_pdmg_indest_0", "Left: Make indestructible Right: Make destructible" )
end

function TOOL:LeftClick( trace )
	
	if SERVER then
		local ent = trace.Entity
	
		if ValidEntity(ent) then
			
			if self:GetOwner():IsAdmin() then
				ent.HealthMade = nil
				ent.org_health = ent:GetMaxHealth()
				ent:SetSaveValue("m_takedamage", 0)
				ent:SetHealth(-1)
			end
			
		end
	end
end

function TOOL:RightClick( trace )
	
	if SERVER then
		local ent = trace.Entity
		
		if ValidEntity(ent) then
			
			if self:GetOwner():IsAdmin() then
				if !ent.HealthMade then
					if ent.org_health then ent:SetHealth(ent.org_health) end
					ent:SetSaveValue("m_takedamage", 1)
					_G.pdmg_dohealth(ent)
				end
			end
			
		end
	end
end

function TOOL:Reload( trace )

end

function TOOL.BuildCPanel( CPanel )
	
	CPanel:AddControl( "Header", { Text = "#Tool_pdmg_indest_name", Description	= "#Tool_pdmg_indest_desc" }  )

end

function TOOL:Think()
	
end

function TOOL:Deploy()

end

function TOOL:Holster()

end